﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VirtualDrum.lib
{
	class Player
	{
		private string _musicPath;
		private AxWMPLib.AxWindowsMediaPlayer _objPlayer;
		public Player(System.ComponentModel.ComponentResourceManager resources,string playerName){
			this._musicPath = "";
			this._objPlayer = new AxWMPLib.AxWindowsMediaPlayer();
			this._objPlayer.Enabled = true;
			this._objPlayer.Visible = false;
			this._objPlayer.Hide();
			//this._objPlayer.Location = new System.Drawing.Point(100, 51);
			this._objPlayer.Size = new System.Drawing.Size(0, 0);
			//this._objPlayer.TabIndex = 11;
			this._objPlayer.Name = playerName;
			this._objPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject(playerName + ".OcxState")));
		}

		public void play(){
			this._objPlayer.URL	= this._musicPath;
			this._objPlayer.Ctlcontrols.play();
		}

		public void stop(){
			this._objPlayer.Ctlcontrols.stop();
		}

		public void setEnable(Boolean enable){
			this._objPlayer.Enabled = enable;
		}

		public string MusicPath{
			get { return this._musicPath; }
			set { this._musicPath = value; }
		}

		public AxWMPLib.AxWindowsMediaPlayer ObjPlayer{
			get { return this._objPlayer; }
			set { this._objPlayer = value; }
		}
	}
}
